<?php
include 'conn.php';
if ($_REQUEST["tid"]){
    
     $tid = $_REQUEST["tid"];
    
     $ro = $db -> get_row("SELECT * FROM `wx_article` WHERE tid = '$tid'");
     $http = $ro -> url;
    
     $smarty = new Smarty;
     phpQuery :: newDocumentFile($http);
     $val = pq("div.global_error_msg.warn") -> html();
    
     if($val){
         echo "SORRY!Delete!";
		 $db->query("UPDATE `wx_article` SET `del` ='1' WHERE  `tid` = '$tid'");
         header ("location: index.php");
         exit ();
         }else{
		$db->query("UPDATE `wx_article` SET `hits` =hits+1 WHERE  `tid` = '$tid'");
         Header("Location:$http");
         exit ();
         }
     }else{
     echo "SORRY!";
     header ("location: index.php");
     exit ();
    
     }

?>